import java.util.ArrayList;
import java.util.Date;


public class Product extends Record {
	
	private int category;
	private String name;
	private int height;
	private int depth;
	private int width;
	private int priority;
	private float price;
	
	private int monthlySales;
	private int currentCount;
	
	private ArrayList<Quantity> quantities;
	

	public Product(String table, int id, String createdOn, String modifiedOn,
			int createdBy, int modifiedBy) {
		super(table, id, createdOn, modifiedOn, createdBy, modifiedBy);
		this.category = 0;
		this.name = "NA";
		this.height = 0;
		this.depth = 0;
		this.width = 0;
		this.priority = 0;
		this.monthlySales = 0;
		this.currentCount = 0;
		this.price = 0;
	}
	
	public Product(String table, String createdOn, String modifiedOn,
			int createdBy, int modifiedBy, int id, int category, String name, int height, int depth, int width, int priority, int sales, int count) {
		super(table, id, createdOn, modifiedOn, createdBy, modifiedBy);
		this.category = category;
		this.name = name;
		this.height = height;
		this.depth = depth;
		this.width = width;
		this.priority = priority;
		this.monthlySales = sales;
		this.currentCount = count;
		this.price = 0;
	}
	
	public Product(int category, String name, int height, int depth, int width, int priority, int sales, int count) {
		super("sharedProducts", 0, new Date().toString(), new Date().toString(), 1, 1);
		this.category = category;
		this.name = name;
		this.height = height;
		this.depth = depth;
		this.width = width;
		this.priority = priority;
		this.monthlySales = sales;
		this.currentCount = count;
		this.price = 0;
	}
	
	public Product() {
		super("sharedProducts", 0, new Date().toString(), new Date().toString(), 1, 1);
		this.category = 0;
		this.name = "NA";
		this.height = 0;
		this.depth = 0;
		this.width = 0;
		this.priority = 0;
		this.monthlySales = 0;
		this.currentCount = 0;
		this.price = 0;
	}
	
	public int getMonthlySales() {
		return monthlySales;
	}

	public void setMonthlySales(int monthlySales) {
		this.monthlySales = monthlySales;
	}

	public int getCurrentCount() {
		return currentCount;
	}

	public void setCurrentCount(int currentCount) {
		this.currentCount = currentCount;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	public String getProductName() {
		return name;
	}

	public void setProductName(String productName) {
		this.name = productName;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}
	
	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}
	
	public void addQuantity(Quantity q){
		if(quantities == null)
			quantities = new ArrayList<Quantity>();
		this.quantities.add(q);
		
	}
	public ArrayList<Quantity> getQuantities(){
		return this.quantities;
	}
  
	public String toString(){
		return "Name: "+name+" Category: "+category+" Height = "+height+" Width = "+width+ " Depth = "+depth+" Priority = "+priority+ " Monthly Sales = "+monthlySales;
	}
}
